/*
 * AbsLenSearcher.cc
 *
 *  Created on: 14.04.2011
 *      Author: ed
 */
#include "globals.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Detector.hh"
#include "PhysicsList.hh"
#include "PrimariesGenerator.hh"
#include "G4UIExecutive.hh"
#include "G4VisManager.hh"
#include "RootSearch.hh"
int main()
{
	G4RunManager* runManager = new G4RunManager;
	Detector *detector = new Detector(1*m,10*m,1*m);
	runManager->SetUserInitialization(detector);
	G4VUserPhysicsList *physics = new PhysicsList();
	runManager-> SetUserInitialization(physics);
	G4VUserPrimaryGeneratorAction* gen_action = new PrimariesGenerator(1000);
	runManager->SetUserAction(gen_action);

	runManager->Initialize();


	G4UImanager* UI = G4UImanager::GetUIpointer();
	UI->ApplyCommand("/run/verbose 0");
	UI->ApplyCommand("/event/verbose 0");
	UI->ApplyCommand("/tracking/verbose 0");

	RootSearch s(detector,runManager);
	s.Root(0.1,0.03*m,0.01,0.3*m,100*m);
	//detector->SetLAbs(11516);
	runManager->BeamOn(1);
	delete runManager;
	return 0;
}
